package exp.parser;

import grammar.parser.FuncFParams;

public class ConstExp extends ExpParser {
    private final AddExp addExp;

    public ConstExp(AddExp addExp) {
        super(addExp.isComputable(), addExp.isConst());
        this.addExp = addExp;
    }

    public static ConstExp buildAndCompute() {
        ConstExp constExp = new ConstExp(AddExp.parserAddExp());
        constExp.getValue();
        return constExp;
    }

    @Override
    public LVal toLVal() {
        return null;
    }

    @Override
    public Integer compute() {
        return addExp.compute();
    }

    @Override
    public FuncFParams.FuncFParam checkDimension() {
        return addExp.checkDimension();
    }
}
